<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h1>cookle</h1>
</body>
<script>
    document.cookie = "name = 罗志康"
    document.cookie = "age = 18"


    let date = new Date()//创建当前日期
    date.setDate(date.getDate()+2) //当前日期加几 就是几天
    document.cookie="sex = 男; expires=" + date;


    // document.cookie="sex= "; //删除
    console.log(document.cookie)
</script>
</html>